<?php
require_once("../includes/Specialization.class.php");
include("../header.php");
?>


<form name="add_form" action="add_user_DB.php" method="post">
	<div class="container">
    
		<div class="ten columns offmar-by-one ">
			<label class="three column"> ID : </label>
			 <input type="text" name="ID" class="three column marleft-by-six"/> 
			<label class="required last_check two column">  </label>
		</div>
        
        
        <div class="row"></div>
        
     <div class="eight columns offmar-by-one ">
     	<label class="three column"> name : </label>
     	<input type="text" name="name"  class="three column marleft-by-five"/> 
     	<label class="required last_check">  </label>
     </div>    
       
       <div class="row"></div>
       
     <div class="eight columns offmar-by-one ">
     	<label class="three column"> E-mail : </label>
     <input type="text" name="email"  class="three column marleft-by-five"/>
     	<label class="required last_check"> </label>
     </div>
     
     <div class="row"></div>
     
     <div class="eight columns offmar-by-one ">
     	<label class="three column"> Password : </label>
     	 <input type="password" name="password"  class="three column marleft-by-four"/> 
     	<label class="required last_check"> </label>
     </div>
     
     <div class="row"></div>
      
     <div class="ten columns offmar-by-one ">
      <label class="three column"> Specialization: </label>
        
        <select id = "specialization" name="specialization" onchange="subspecialization(this.options[this.selectedIndex].value)" class="three column marleft-by-three">
            <option value=""></option>
             <?php
              $Types = Specialization::find_all_ids();   
              for ( $i = 0 ; $i < count($Types) ; $i++ )
                {

                 echo "<option value =" . $Types[$i];
                 echo ">" . Specialization::find_type_name($Types[$i]) . "</option>";
                }
             ?>
        </select>
        
       <label class = "required last_check"></label>
     </div>
     
     <div class="row"></div>

     <div class="eight columns offmar-by-one ">
     	<label class="three column"> phone_number: </label>
     	 <input type = "text" name = "phone" class="three column marleft-by-three"/> 
     	 
     </div>
      
      <div class="row"></div>
      
     <div class="eight columns offmar-by-one ">
     	<label class="three column"> home_address: </label>
     	  <input type="text" name="home_address" class="three column marleft-by-three">  
     	 
     </div>
      
      <div class="row"></div>
       
     <div class="eight columns offmar-by-one "> 
     	<label class="three column"> gender: </label>
     	 <input type="radio" name="gender" value="M" checked  class="three column  marleft-by-eight"/> Male
         <div class="row"></div>
            <input type="radio" name="gender" value="F"  class="three column  marleft-by-ten"/> Female
         
     	 
     </div>
     
     <div class="row"></div>
     
     <div class="ten columns offmar-by-one ">
     	<label class="three column"> user_type: </label>
     	 <SELECT name="user_type" id="user_type" onchange="subspecialization(this.options[this.selectedIndex].value)" class="three column  marleft-by-five">
            <OPTION value=""> </option>
            <OPTION value="doctor"> Doctor </option>
            <OPTION value="teacher"> Teacher </option>
            <OPTION value="student"> Student </option>
            </SELECT>
         
     	<label class="required last_check" > </label>
     </div>
     
<div class="row"></div>

    <div id="level" class = "hidden eight columns offmar-by-one ">
       <label class="three column"> Level : </label>
        
         <select name="level" class="three column  marleft-by-six">
            <option value=""></option>
            <option value="1">level 1</option>
            <option value="2">level 2</option>
            <option value="3">level 3</option>
            <option value="4">level 4</option>
         </select>
        
       <label class="required last_check"></label>
    </div>

<div class="row"></div>
    <div id = "sub" class = "hidden eight columns offmar-by-one">
       <label class="three column"> SubSpecialization  </label>
          <select name="subSpecialization" id="subSpecializationSelect" class="three column  marleft-by-two">
             <option value=""></option>
             <?php
              $Types=Specialization::find_all_ids();   
              for ( $i=0 ; $i < count($Types) ; $i++ )
               {
                 if($Types[$i] != 1)
                   {
                     echo "<option value=".$Types[$i];
                     echo " ><div class='row'></div>" . Specialization::find_type_name($Types[$i]) . "</option>";
                   }
                }
             ?>
          </select>
         
        <label class="required last_check"></label>
    </div>

<div class="row"></div>
	 <div class="eight columns offmar-by-one">
        <input id="submit" class="three column" type="button" value="Submit" onclick="validate_add_user_form()">
     </div>	
</div>
</form>